package cn.com.chengmandian.core.web.exceptions;

import cn.com.chengmandian.core.common.constants.ResponseCode;
import lombok.Data;

/**
 * 通用接口返回异常
 */
@Data
public class BadResponseException extends RuntimeException{
    /**
     *
     */
    private int code; // 异常代码

    private Object data;

    public BadResponseException() {
    }

    public BadResponseException(String message) {
        super(message);
        this.code = ResponseCode.ERROR;
    }

    public BadResponseException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BadResponseException(int code, String message, Object data) {
        super(message);
        this.code = code;
        this.data = data;
    }
}
